from get_patch import*  
from gain import * 
from torch.utils.data import DataLoader
if __name__=="__main__":
    # original data generates patch
    data_dir = "D:\python_lab\denoiser\python_segy\data\\test"
    train_data = datagenerator(data_dir,patch_size = (128,128),stride = (32,32), train_data_num = float('inf'), download=False,datasets=[],aug_times=0,scales = [1],verbose=True,jump=1,agc=True)

    train_data = train_data.astype(np.float64)
    #纯净数据
    xs = torch.from_numpy(train_data.transpose((0, 3, 1, 2)))
    batch_size = 16

    # add noise
    #添加噪声
    DDataset = DenoisingDataset(xs,25)

    DLoader = DataLoader(dataset=DDataset, num_workers=4, drop_last=False, batch_size=batch_size, shuffle=True)

    for n_count, batch_yx in enumerate(DLoader):
        # 返回加噪数据与纯净数据
        batch_x, batch_y = batch_yx[1], batch_yx[0]
        print(batch_x.shape)
        break
    '''
    #random downsampling，rate : the sampling rate
    DDataset = DownsamplingDataset(xs,rate = 0.7,regular = False)
    #sampling regularly, rate ： sampling interval
    DDataset = DownsamplingDataset(xs,rate = 2,regular = True)
    '''



老师您好，就是我今天跑了一下这个test的数据，发现是一条